﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using MassTransit;
namespace Athena
{
    public class RabbitMqUriAttribute : Attribute
    {
        public string VirtualHost {
            get; set;
        }

        public string Exchange {
            get; set;
        }

        public string ExchangeType {
            get; set;
        }


        public string Queue {
            get; set;
        }

        public Type FaultHandleType {
            get; set;
        }

        public ushort PrefetchCount {
            get; set;
        }

        private object _faultHandle;
        public object FaultHandle {
            get {
                if (FaultHandleType == null)
                {
                    return null;
                }
                if (_faultHandle == null)
                {
                    _faultHandle = Activator.CreateInstance(FaultHandleType);
                }
                return _faultHandle;
            }
        }

        public RabbitMqUriAttribute()
        {

        }
    }
}
